<extend name="Public:index" />
<block name="left">
	<ul >
		<li><a href="{:U('admin/Yygame/update_game_user')}">添加指定获奖用户</a></li>
		<li><a href="{:U('admin/Yygame/user_prizes_list')}">指定用户列表</a></li>
        <li><a href="{:U('admin/Yygame/code_list')}">参与码列表</a></li>
	</ul>
</block>
<block name="right" >
	<form method="post" action="" id="form" style="width:90%">
		<div class="form-group">
			<label for="exampleInputEmail1">参与码</label>
			<input  id="code" name="code" placeholder="请输入参与码" class="wechat form-control"  value="{$data.code}"/>
		</div>

		<div class="form-group">
			<label for="exampleInputPassword1">奖&nbsp;项</label>
            <select id="prizes_id"  name="prizes_id" class="name form-control">
             <option value="">请选择奖项等级</option>
            <foreach name="prizes_list" item="pl">
            <option value="{$pl.prizes_id}">{$pl.prizes_name}(奖池剩余{$pl.surplus}个)</option>
            </foreach>
            </select>
			
		</div>
<!--		<div class="form-group">
			<label for="exampleInputPassword1">优先级</label>
            <input id="u_order" type="text" name="u_order" placeholder="请输入优先级"  class="name form-control" value="{$data.user_info.order}" />		
       </div>-->


        <input name="u_prize_id" type="hidden" value="{$data.u_prize_id}" />
		<input type="button" value="提交" onclick="js_game_user()" class="btn btn-default">
	</form>
    <div class="form-group"><label for="exampleInputPassword1">提示：当前奖池内必须有奖项才能添加，便于减指定奖项数量。注意以后使用该code不再减奖池奖项，请及时取消或使用</label></div>
    <script>

function js_game_user(){
	var code=$('#code').val();
	var prizes_id=$('#prizes_id').val();
	/*var u_order=$('#u_order').val();*/


	if(code==''){
		alert("请输入参与码");
		return false;
	}
	if(prizes_id==''){
		alert("请选择奖项等级");
		return false;
	}
/*	if(u_order==''){
		alert("请输入优先级");
		return false;
	}
	else if(isNaN(u_order)){
		alert("优先级必须是数字");
		return false;
	}*/
	

	$('#form').ajaxSubmit({
		type: 'post', 
		url: 'index.php?m=admin&c=Yygame&a=update_game_user',
		success: function(data) {  
		  alert(data);
/*		   if(data!='更新成功')
		   {
			$('#form').resetForm(); 
		   }*/
			
		}

	});
	return false; 
    }


	</script>
</block>
